package com.fbs.wowo.classify.service.imp;

import com.fbs.wowo.classify.entity.Classify;
import com.fbs.wowo.classify.mapper.ClassifyMapper;
import com.fbs.wowo.classify.service.ClassifyService;
import com.fbs.wowo.util.common.ComUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;


@Service
@Transactional
public class ClassifyServiceImp implements ClassifyService {

    @Resource
    private ClassifyMapper classifyMapper;

    /**
     * 添加类型
     * @param record
     * @return
     */
    @Override
    public int insertSelective(Classify record) {
        record.setId(ComUtils.getUUID());
        return classifyMapper.insertSelective(record);
    }

    /**
     * 查询类型列表
     * @return
     */
    @Override
    public List<Classify> findClassifyList() {
        return classifyMapper.findClassifyList();
    }

    /**
     * 根据主键查询此类型
     * @param id
     * @return
     */
    @Override
    public Classify selectByPrimaryKey(String id) {
        return classifyMapper.selectByPrimaryKey(id);
    }
}
